package com.example.myaptuselearing

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.example.app_use_module.AppUseModuleMainActivity
import com.example.apt_annotation.ViewBind
import com.example.apt_api.ButtonKnife
import com.example.myaptuselearing.annotation_introduce.AnnotationInit


class VerifyCustomAnnotationActivity : AppCompatActivity() {

    companion object {
        private const val TAG = "VerifyCustomAnnotationActivity"
    }

    @ViewBind(R.id.bt_1)
    lateinit var bt1: Button

    @ViewBind(R.id.bt_2)
    lateinit var bt2: Button

    @ViewBind(R.id.bt_start_second)
    lateinit var btStartAppUseModule: Button


    lateinit var btVerify: Button

    @SuppressLint("LongLogTag")
    @AnnotationInit(address = "hangzhou")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.verify_main)
        ButtonKnife.bind(this)

        btVerify = findViewById(R.id.bt_start)
        btVerify.setOnClickListener {
            Log.d(TAG, "onCreate: ${bt2.text.toString()}")

        }

        /**去另一个activity中验证自定义注解是否可用*/
        btStartAppUseModule.setOnClickListener {
            startActivity(Intent(this, AppUseModuleMainActivity::class.java))
        }
    }


}